import { get, post } from "../utils/request";

// 获取最热帖子
export const postHot = () => get("/api/v1/posts/hot");
// 获取最新帖子
export const postNew = () => get("/api/v1/posts/fresh");
//发帖
export const postAdd = (data) => post("/api/v1/posts", data);
//帖子列表 分类获取
// 传参理解 后面一个对象实际上是{forum:forum,page:page}实参为属性值
export const loadList = (forum, page) => get("/api/v1/posts", { forum, page });
// 帖子详情
export const loadDetail = (id) => get("/api/v1/posts/" + id);
